package com.shenchuangit.webprintclient;

import com.shenchuangit.webprintclient.cycle.AbstractPrintJobHandler;
import com.shenchuangit.webprintclient.cycle.AbstractPrintJobPreHandler;
import com.shenchuangit.webprintclient.server.WebPrintRequestServer;

public class PrintClient {
    private WebPrintRequestServer webPrintRequestServer = new WebPrintRequestServer();

    private AbstractPrintJobPreHandler printJobPreHandler;
    private AbstractPrintJobHandler printJobHandler;

    public PrintClient() {

    }

    public WebPrintRequestServer getWebPrintRequestServer() {
        return webPrintRequestServer;
    }

    public void setWebPrintRequestServer(WebPrintRequestServer webPrintRequestServer) {
        this.webPrintRequestServer = webPrintRequestServer;
    }

    public AbstractPrintJobPreHandler getPrintJobPreHandler() {
        return printJobPreHandler;
    }

    public void setPrintJobPreHandler(AbstractPrintJobPreHandler printJobPreHandler) {
        this.printJobPreHandler = printJobPreHandler;
    }

    public AbstractPrintJobHandler getPrintJobHandler() {
        return printJobHandler;
    }

    public void setPrintJobHandler(AbstractPrintJobHandler printJobHandler) {
        this.printJobHandler = printJobHandler;

        if (null != printJobPreHandler) {
            webPrintRequestServer.init(printJobPreHandler, printJobHandler);
        } else {
            System.out.println("打印作业预处理程序未加载");
        }
    }
}

